home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: Variable paramater list macros
- Date: 12 Jan 1996 21:03:03 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Jan12140303@qcd.lanl.gov>
- References: <4crc3v$hm8@barnacle.iol.ie> <TANMOY.96Jan8085718@qcd.lanl.gov>
- <JARNOT.96Jan11165456@box10.dstar.iddis.com>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: jarnot@iddis.com's message of 11 Jan 1996 21:54:56 GMT
-
- --text follows this line--
- In article <JARNOT.96Jan11165456@box10.dstar.iddis.com>
- jarnot@iddis.com (Kevin J. Jarnot) writes:
- <snip>
- Derek> I want to replace a variable
- Derek> argument list function (which I use for debugging ) with a
- Derek> macro that does nothing.
- Derek> Unfortunately I can't remember how to write a macro
- Derek> that takes a variable number of paramaters ! Can you ?
-
- Tanmoy> The question has no answer within the C
- Tanmoy> language. Individual compilers may provide a way. Please
- Tanmoy> ask in a system/compiler specific group.
- Tanmoy> The FAQ has a little to say about this.
-
-
- Actually, this is not 100% true. I use the following macro for debugging
- all the time:
-
- #if defined(DEBUG)
- #define DPRINTF(args) (dprintf args) // Only print when DEBUG is declared
- #else
- #define DPRINTF(args) // O/w, the code won't even
- be there!
- #endif
-
- Yes, that is the reason why I referred to the FAQ. I said `a little'
- because this needs a change in the calling convention from single to
- double parens.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-